import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { Aaa2Service } from './aaa2.service';
import { CreateAaa2Dto } from './dto/create-aaa2.dto';
import { UpdateAaa2Dto } from './dto/update-aaa2.dto';
import { RequireLogin } from '../RequireLoginDecorator';

@Controller('aaa2')
@RequireLogin()
export class Aaa2Controller {
  constructor(private readonly aaa2Service: Aaa2Service) {}

  @Post()
  create(@Body() createAaa2Dto: CreateAaa2Dto) {
    return this.aaa2Service.create(createAaa2Dto);
  }

  @Get()
  findAll() {
    return this.aaa2Service.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.aaa2Service.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateAaa2Dto: UpdateAaa2Dto) {
    return this.aaa2Service.update(+id, updateAaa2Dto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.aaa2Service.remove(+id);
  }
}
